import pymysql

conn = pymysql.connect(
    host='localhost',
    port=3306,
    user='root',
    password='yzm12345',
    db='forestry_protection',
    charset='utf8',
    # cursorclass = cursors.DictCursor
)
cursor = conn.cursor()

username = "admin"
password = "admin"

select_sql = 'select password from user where username = %s'
cursor.execute(select_sql, username)
select_password = cursor.fetchone()[0]
print(select_password)

power_sql = 'select jurisdiction from user where username = %s'
cursor.execute(power_sql, username)
select_power = cursor.fetchone()[0]
print(select_power)

if password == select_password and select_power == 1:
    print("success")
else:
    print("error")